<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/adminjsps/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <meta charset="utf-8">
    <title>Roles | Strass</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="Admin panel developed with the Bootstrap from Twitter.">
    <meta name="author" content="travis">

    <link href="css/bootstrap.css" rel="stylesheet">
	<link href="css/site.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>
  <body>
   <%@include file="/adminjsps/head.jsp"%>

    <div class="container-fluid">
      <div class="row-fluid">
       <%@include file="/adminjsps/left.jsp"%>
        <div class="span9">
		  <div class="row-fluid">
			<div class="page-header">
				<h1>用户 <small>用户管理</small></h1>
			</div>
			<table class="table table-striped table-bordered table-condensed">
				<thead>
					<tr>
						<th></th>
						<th>用户名</th>
						<th>邮箱</th>
						<th>手机号码</th>
						<th>兴趣爱好</th>
						<th>级别</th>
						<th>权限管理</th>
					</tr>
				</thead>
				<tbody>
				<c:forEach items="${pb.beanList }" var="user">
				<tr class="list-roles">
					<td>$</td>
					<td>${user.gusername }</td>
					<td>${user.gmail }</td>
					<td>${user.gtel }</td>
					<td>${user.ginterest }</td>
					<td><c:choose>
					<c:when test="${user.level eq 1 }">管理员</c:when>
					<c:when test="${user.level eq 2 }">商家</c:when>
						<c:when test="${user.level eq 3 }">普通会员</c:when>
					</c:choose></td>
					<td>
						<div class="btn-group">
							<a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">权限管理 <span class="caret"></span></a>
							<ul class="dropdown-menu pull-right">
								<c:choose>
					<c:when test="${user.level eq 2 }"><li><a href="<c:url value='/UserServlet?method=level&gusername=${user.gusername }&level=-1'/>"><i class="icon-pencil"></i>升级</a></li></c:when>
					<c:when test="${user.level eq 3 }"><li><a href="<c:url value='/UserServlet?method=level&gusername=${user.gusername }&level=-1'/>"><i class="icon-pencil"></i>升级</a></li></c:when>
					
					</c:choose>
								<c:choose>
					<c:when test="${user.level eq 1 }"><li><a href="<c:url value='/UserServlet?method=level&gusername=${user.gusername }&level=1'/>"><i class="icon-trash"></i> 降级</a></li></c:when>
					<c:when test="${user.level eq 2 }"><li><a href="<c:url value='/UserServlet?method=level&gusername=${user.gusername }&level=1'/>"><i class="icon-trash"></i>降级</a></li></c:when>
					
					</c:choose>
							</ul>
						</div>
					</td>
				</tr>				
				</c:forEach>
				</tbody>
			</table>
			<a href="new-role.html" class="btn btn-success">New Role</a>
		  </div>
        </div>
      </div>

      <hr>

      <footer class="well">
        &copy; Strass - More Templates <a href="http://www.cssmoban.com/" target="_blank" title="æ¨¡æ¿ä¹å®¶">æ¨¡æ¿ä¹å®¶</a> - Collect from <a href="http://www.cssmoban.com/" title="ç½é¡µæ¨¡æ¿" target="_blank">ç½é¡µæ¨¡æ¿</a>
      </footer>

    </div>

    <script src="js/jquery.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script>
	$(document).ready(function() {
		$('.dropdown-menu li a').hover(
		function() {
			$(this).children('i').addClass('icon-white');
		},
		function() {
			$(this).children('i').removeClass('icon-white');
		});
	});
	</script>
  </body>
</html>
